#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>

void on_input(int signum)
{
	printf("sigio\n");
}
int main(int argc, char *argv[])
{
	signal(SIGIO, on_input);
	fcntl(STDIN_FILENO, F_SETOWN, getpid());
	fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_ASYNC);
	pause();
	return 0;
}
